#page_box_wide
  %h1.page_title
    = "#{link_to "Home", "/"} > #{link_to "Administrate", "/admins"} > Posts"
  .create_link
    = link_to "#{image_tag("icons/plus.gif", :alt => "")} New Post",  :action => :new_post
  .menu
    = render :partial => "menu"
  %br{:style => "clear:both;"}
  %table
    %tr
      %th Title
      %th Published At
      %th Views
      - if APP_SETTINGS[:comments_system] == "internal"
        %th Comments
      %th
    - for post in @posts.reverse
      %tr
        %td
          = link_to post.title, post
        %td
          = "#{time_ago_in_words(post.published_at)} ago"
        %td
          = post.views if post.views
        - if APP_SETTINGS[:comments_system] == "internal"
          %td
            = post.comments.count if post.comments
        %td{:align => "right"}
          = link_to image_tag("icons/trash.gif", :alt => "delete"), {:action => :destroy_post, :id => post.id }, :confirm => "Are you sure you want to delete this post?"
          = link_to image_tag("icons/edit.gif", :alt => "delete"), :action => :edit_post, :id => post.id
          = link_to image_tag("icons/lock.gif", :alt => "lock"), :action => :lock_post, :id => post.id
  %br
  = will_paginate @posts 
